<?php
use Webman\Route;

// 子卡管理
Route::group('/black-card-sub', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'list']);
    Route::post('/create', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'create']);
    Route::post('/update', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'update']);
    Route::post('/delete', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'delete']);
    Route::post('/status', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'updateStatus']);
    Route::get('/detail', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'detail']);
    Route::post('/allocate-balance', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'allocateBalance']);
    Route::get('/balance-log', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'balanceLog']);
});

// 商家类型管理
Route::group('/business-type', function() {
    Route::get('/list', [plugin\ky_black\app\admin\controller\BusinessTypeController::class, 'list']);
    Route::get('/all', [plugin\ky_black\app\admin\controller\BusinessTypeController::class, 'all']);
    Route::post('/add', [plugin\ky_black\app\admin\controller\BusinessTypeController::class, 'add']);
    Route::post('/edit', [plugin\ky_black\app\admin\controller\BusinessTypeController::class, 'edit']);
    Route::post('/status', [plugin\ky_black\app\admin\controller\BusinessTypeController::class, 'status']);
});

// 商家管理
Route::group('/business-partner', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'list']);
    Route::get('/all', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'all']);
    Route::get('/detail', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'detail']);
    Route::post('/add', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'add']);
    Route::post('/edit', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'edit']);
    Route::post('/status', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'status']);
});

// 产品分类
Route::group('/product-category', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'list']);
    Route::post('/add', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'add']);
    Route::post('/edit', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'edit']);
    Route::post('/delete', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'delete']);
});

// 产品管理
Route::group('/product', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\ProductController::class, 'list']);
    Route::post('/add', [plugin\ky_black\app\admin\controller\ProductController::class, 'add']);
    Route::post('/edit', [plugin\ky_black\app\admin\controller\ProductController::class, 'edit']);
    Route::post('/delete', [plugin\ky_black\app\admin\controller\ProductController::class, 'delete']);
});

// 服务管理
Route::group('/service', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\ServiceController::class, 'list']);
    Route::get('/options', [plugin\ky_black\app\admin\controller\ServiceController::class, 'options']);
    Route::post('/add', [plugin\ky_black\app\admin\controller\ServiceController::class, 'add']);
    Route::post('/edit', [plugin\ky_black\app\admin\controller\ServiceController::class, 'edit']);
    Route::post('/delete', [plugin\ky_black\app\admin\controller\ServiceController::class, 'delete']);
});

// 服务记录
Route::group('/service/record', function () {
    Route::get('/{id}', [plugin\ky_black\app\admin\controller\ServiceRecordController::class, 'detail']);
    Route::get('/list', [plugin\ky_black\app\admin\controller\ServiceRecordController::class, 'list']);
    Route::post('', [plugin\ky_black\app\admin\controller\ServiceRecordController::class, 'add']);
    Route::put('/{id}', [plugin\ky_black\app\admin\controller\ServiceRecordController::class, 'edit']);
    Route::post('/complete', [plugin\ky_black\app\admin\controller\ServiceRecordController::class, 'complete']);
});

// 会员权益
Route::group('/member-rights', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\MemberRightsController::class, 'list']);
    Route::get('/options', [plugin\ky_black\app\admin\controller\MemberRightsController::class, 'options']);
    Route::post('/add', [plugin\ky_black\app\admin\controller\MemberRightsController::class, 'add']);
    Route::post('/edit', [plugin\ky_black\app\admin\controller\MemberRightsController::class, 'edit']);
    Route::post('/delete', [plugin\ky_black\app\admin\controller\MemberRightsController::class, 'delete']);
});

// 订单管理
Route::group('/order', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\OrderController::class, 'list']);
    Route::get('/detail', [plugin\ky_black\app\admin\controller\OrderController::class, 'detail']);
    Route::post('/cancel', [plugin\ky_black\app\admin\controller\OrderController::class, 'cancel']);
    Route::post('/complete', [plugin\ky_black\app\admin\controller\OrderController::class, 'complete']);
    Route::post('/refund', [plugin\ky_black\app\admin\controller\OrderController::class, 'refund']);
});

// 黑卡规则
Route::group('/black-card/rule', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\BlackCardRuleController::class, 'list']);
    Route::post('', [plugin\ky_black\app\admin\controller\BlackCardRuleController::class, 'add']);
    Route::put('/{id}', [plugin\ky_black\app\admin\controller\BlackCardRuleController::class, 'edit']);
    Route::put('/{id}/status', [plugin\ky_black\app\admin\controller\BlackCardRuleController::class, 'updateStatus']);
});

// 文件上传
Route::post('/upload', [plugin\ky_black\app\admin\controller\UploadController::class, 'upload']);

// 景区产品管理
Route::group('/scenic-product', function () {
    Route::get('/list', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'list']);
    Route::get('/options', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'options']);
    Route::get('/detail', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'detail']);
    Route::post('/add', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'add']);
    Route::post('/edit', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'edit']);
    Route::post('/delete', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'delete']);
    Route::post('/status', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'status']);
}); 